<?php

namespace app\adm\controller;

use app\base\BaseController;
use app\load\loadServices\AdminServices;
use think\Exception;

/**
 * 员工控制器
 */
class Admin extends BaseController
{


    /**
     * 部门下的员工
     * @return void
     */
    public function dep_admin_list()
    {
        $input = input();
        try {
            $department = ($input['did'] == 1) ? $input['did'] : get_department_son($input['did']);
            $where[] = ['a.status' ,'=', 1];
            $where[] = ['a.id', '>', 1];
            $where[] = ['a.did', 'in', $department];
            $result = AdminServices::Admin()->departmentUserList($where);
            return to_assign(0,'请求成功' , $result);
        } catch (Exception $e) {
            return to_assign(1, $e->getMessage());
        }
    }


}